﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace Throw_In
{
    class Players
    {
        public string apiKey = "api.key.28923403350bc3d2064499";
        public string apiSecret = "api.secret.196798694850bc3d2064516";
        public Players()
        {
        }
        public string jsonTeams(int offset=0)
        {
            //http://www.bolalob.com/api.php/teams/index/api.key.12345/api.secret.987654321
            return "";
        }
        public string jsonTeamCategory(int idCat=0)
        {
            return "http://www.bolalob.com/api.php/teams/index/api.key.12345/api.secret.987654321";
        }
        public string jsonTag(string tag, int offset)
        {
            return " http://www.bolalob.com/api.php/teams/tag/api.key.12345/api.secret.987654321/persija, persipura/1";

        }
        public string jsonDetails(int idNews)
        {
            return " http://www.bolalob.com/api.php/teams/detail/api.key.12345/api.secret.987654321/68";

        }
        public void retrieve()
        {
            string inputString = @"
                [{""id"":""1"",""name"":""Bola"",""child"":[{""id"":""2"",""name"":""Internasional"",""child"":[{""id"":""20"",""name"":""World Football"",""child"":[{""id"":""106"",""name"":""SEA Games 2011"",""child"":[{""id"":""107"",""name"":""Putra"",""child"":[{""id"":""109"",""name"":""Grup A"",""child"":[]},{""id"":""110"",""name"":""Grup B"",""child"":[]}]},{""id"":""108"",""name"":""Putri"",""child"":[]}]},{""id"":""117"",""name"":""Euro 2012"",""child"":[{""id"":""147"",""name"":""Grup A"",""child"":[]},{""id"":""148"",""name"":""Grup B"",""child"":[]},{""id"":""149"",""name"":""Grup C"",""child"":[]},{""id"":""150"",""name"":""Grup D"",""child"":[]}]},{""id"":""132"",""name"":""Olimpiade 2012"",""child"":[{""id"":""133"",""name"":""Grup A"",""child"":[]},{""id"":""134"",""name"":""Grup B"",""child"":[]},{""id"":""135"",""name"":""Grup C"",""child"":[]},{""id"":""136"",""name"":""Grup D"",""child"":[]}]},{""id"":""156"",""name"":""Piala Dunia 2014"",""child"":[]}]},{""id"":""21"",""name"":""Liga Champion"",""child"":[{""id"":""140"",""name"":""Grup A"",""child"":[]},{""id"":""141"",""name"":""Grup B"",""child"":[]},{""id"":""143"",""name"":""Grup C"",""child"":[]},{""id"":""144"",""name"":""Grup D"",""child"":[]},{""id"":""145"",""name"":""Grup E"",""child"":[]},{""id"":""146"",""name"":""Grup F"",""child"":[]},{""id"":""159"",""name"":""Grup G"",""child"":[]},{""id"":""160"",""name"":""Grup H"",""child"":[]}]},{""id"":""22"",""name"":""UEFA"",""child"":[]},{""id"":""23"",""name"":""Liga Premiere"",""child"":[]},{""id"":""24"",""name"":""Seri A"",""child"":[]},{""id"":""25"",""name"":""La Liga"",""child"":[]},{""id"":""26"",""name"":""Liga Lainnya"",""child"":[]},{""id"":""68"",""name"":""Group Copa America"",""child"":[]},{""id"":""111"",""name"":""Other"",""child"":[]}]},{""id"":""3"",""name"":""Nasional"",""child"":[{""id"":""27"",""name"":""Timnas"",""child"":[]},{""id"":""28"",""name"":""ISL"",""child"":[]},{""id"":""36"",""name"":""Lainnya"",""child"":[]}]},{""id"":""126"",""name"":""Stadion"",""child"":[]},{""id"":""127"",""name"":""Bintang Lapangan"",""child"":[]},{""id"":""128"",""name"":""Info Nobar"",""child"":[]}]},{""id"":""5"",""name"":""Bolatainment"",""child"":[{""id"":""6"",""name"":""Hot Gossip"",""child"":[]},{""id"":""7"",""name"":""Bursa Transfer"",""child"":[]},{""id"":""37"",""name"":""FUNatik"",""child"":[]}]},{""id"":""8"",""name"":""Futsal"",""child"":[{""id"":""9"",""name"":""News"",""child"":[]},{""id"":""10"",""name"":""Event"",""child"":[]},{""id"":""53"",""name"":""Field"",""child"":[]},{""id"":""116"",""name"":""Klub"",""child"":[]},{""id"":""123"",""name"":""Produk"",""child"":[]},{""id"":""131"",""name"":""Indonesia Futsal League"",""child"":[]},{""id"":""137"",""name"":""Piala Dunia Futsal"",""child"":[{""id"":""138"",""name"":""Profil Tim"",""child"":[]},{""id"":""139"",""name"":""News"",""child"":[]}]},{""id"":""151"",""name"":""Futsal PON"",""child"":[{""id"":""152"",""name"":""Grup A"",""child"":[]},{""id"":""153"",""name"":""Grup B"",""child"":[]},{""id"":""154"",""name"":""Grup C"",""child"":[]},{""id"":""157"",""name"":""Grup 1"",""child"":[]},{""id"":""158"",""name"":""Grup 2"",""child"":[]}]},{""id"":""161"",""name"":""Lifuma"",""child"":[{""id"":""162"",""name"":""Divisi Utama"",""child"":[]},{""id"":""163"",""name"":""Divisi Satu"",""child"":[]}]},{""id"":""164"",""name"":""Futsal Academy"",""child"":[]},{""id"":""165"",""name"":""Profil Tokoh"",""child"":[]},{""id"":""166"",""name"":""Profil Pemain"",""child"":[]}]},{""id"":""11"",""name"":""Gallery"",""child"":[{""id"":""13"",""name"":""Highlight"",""child"":[]},{""id"":""14"",""name"":""Tutorial"",""child"":[]},{""id"":""15"",""name"":""Wallpaper"",""child"":[]},{""id"":""16"",""name"":""Hot"",""child"":[{""id"":""17"",""name"":""Player"",""child"":[]},{""id"":""18"",""name"":""Wags"",""child"":[]},{""id"":""19"",""name"":""Fans"",""child"":[]}]}]},{""id"":""50"",""name"":""Arsip"",""child"":[]},{""id"":""62"",""name"":""BolalobTV"",""child"":[]},{""id"":""129"",""name"":""indobarca"",""child"":[]}]
            ";
            var root = JsonConvert.DeserializeObject<ObjectCategory[]>(inputString);

            foreach (var item in root)
            {
                System.Diagnostics.Debug.WriteLine(item.id + " " + item.name + " " );
            }
        }


    }
}
